package com.tulele.vtool.bus.mapper;

import com.tulele.vtool.bus.model.DailyPaperInfo;
import com.tulele.vtool.bus.model.UserInfo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

@Component(value = "userInfoMapper")
public interface UserInfoMapper {

    /**
     * 查询用户创建时间
     * @param userId
     * @return
     */
    UserInfo queryUserCreateTime(@Param("userId")Integer userId);

    /**
     * 查询用户的VIP状态
     * @param userId
     * @return
     */
    Integer queryUserVipStatus(@Param("userId")Integer userId);

    /**
     * 查询用户订阅相关
     * @param userId
     * @return
     */
    UserInfo queryUserSubPnInfo(@Param("userId")Integer userId);

    /**
     * 获取最新用户ID
     * @return
     */
    Integer queryLastestUserId();

    /**
     * 获取最旧用户ID
     * @return
     */
    Integer queryOldestUserId();

    //    查询用户信息
    UserInfo queryUserInfo(@Param("userId")Integer userId);

    //按公众号 查询用户
    List<UserInfo> getUserListByGzhCode(@Param("gzhCode")String gzhCode);

    List<UserInfo> getUserListByNoActivation(@Param("gzhCode")String gzhCode);

    List<UserInfo> getUserListByGzhCodeOut(@Param("gzhCode")String gzhCode);

    List<UserInfo> getAllUserListByGzhCode(@Param("gzhCode")String gzhCode);

    List<UserInfo> queryWillExpire(@Param("gzhCode")String gzhCode);

    DailyPaperInfo getUserDailyPaper(@Param("userId")Integer userId);

    List<UserInfo> queryVIPHasExpired(@Param("gzhCode")String gzhCode);

    List<UserInfo> queryUserListByWeekly(@Param("gzhCode")String gzhCode);

    List<UserInfo> queryNotVipUserList(@Param("gzhCode")String gzhCode);

    List<UserInfo> queryNotVipNotDate(@Param("gzhCode")String gzhCode);

    List<UserInfo> getUserByBrandId(@Param("gzhCode")String gzhCode,@Param("brandId")Integer brandId);

    List<UserInfo> queryUserListByCommissionDeduction(@Param("gzhCode")String gzhCode);

    /**
     * 根据userid查询品牌
     * @param userId
     * @return
     */
    String getUserBrandName(@Param("userId")Integer userId);

    String getSysGzh(@Param("gzhCode")String gzhCode);

    //查询用户信息 By OpenId
    UserInfo getUserByOpenId(@Param("openId")String openId,@Param("gzhCode")String gzhCode);

    List<UserInfo> getUserByQqblQkb();

}